﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Microsoft.Practices.EnterpriseLibrary.Logging;
using SPlusres.Business;

namespace SPlusres.Controller
{
    public class BaseController : System.Web.Mvc.Controller
    {
        /// <summary>
        /// User Login
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        [Attributes.WithOutLogin]
        public JsonResult Login(string UserName, string Password)
        {
            return Json(Business.Common.UserInfo.Login(UserName, Password));
        }

        /// <summary>
        /// System Exception
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnException(ExceptionContext filterContext)
        {
            base.OnException(filterContext);

            SystemLog.WriteLog(filterContext.Exception);
        }
    }
}
